<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var num=+prompt("请输入一个三位数");
    var bai=+parseInt(num/100);
    var shi=+parseInt(num/10%10);
    var ge=+parseInt(num%10);
    console.log(num);
    console.log(bai);
    console.log(shi);
    console.log(ge);
    console.log(bai+shi+ge);
</script>